tar xf ${DOWNLOADDIR}/elfutils-0.193.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/elfutils-0.193
	sed -i.orig "s@GENDIS_ENV) \./i386_gendis@GENDIS_ENV) qemu-loongarch64 \./i386_gendis@g" libcpu/Makefile.am
	autoreconf -f
	./configure --prefix=/usr --libdir=/usr/lib64 --build=${CROSS_HOST} \
				--host=${CROSS_TARGET} --disable-debuginfod --enable-libdebuginfod=dummy --enable-maintainer-mode \
				ac_cv_null_dereference=no
	make ${JOBS}
	make DESTDIR=${SYSDIR}/sysroot install
popd
echo '#!/bin/bash -e
qemu-loongarch64 /opt/mylaos/sysroot/usr/bin/eu-readelf "$@"' > ${SYSDIR}/cross-tools/bin/${CROSS_TARGET}-eu-readelf
chmod +x ${SYSDIR}/cross-tools/bin/${CROSS_TARGET}-eu-readelf
